/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ua.kpi.transport.servlet.actions.adding;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import ua.kpi.transport.db.dao.factory.DAOFactory;
import ua.kpi.transport.db.dao.factory.DBEnum;
import ua.kpi.transport.db.dao.interfaces.IRouteDAO;
import ua.kpi.transport.servlet.actions.IAction;
import ua.kpi.transport.util.settings.Pages;

/**
 *
 * @author harker777
 */
public class AddRouteAction implements IAction{

    @Override
    public String execute(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        IRouteDAO rd = DAOFactory.getDAOFactory(DBEnum.MYSQL).getRouteDAO();
        request.setAttribute("route",rd.create());
        
        String page = Pages.getPage(Pages.EDIT_ROUTE_PAGE);
        return page;
    }
    
}
